Properties Filter
An auxiliary library that allows filtering objects by its properties using JSON-serializable expressions
Installation
npm install @nextgis/properties-filter
Usage
General view of expression
[ С , [E1] , [E2] , [EN] ]
Nesting
[ [E1], ['any', [E2], [E3, E4] ], ['any', [E5], [E6] ] ] ]
Example
import { propertiesFilter, featureFilter } from '@nextgis/properties-filter';
const properties = {
place: 'Tofalaria',
area: 21,
};
propertiesFilter(properties, [['place', 'eq', 'Tofalaria']]);
propertiesFilter(properties, [['place', 'in', ['Tofalaria', 'Siberia']]]);
propertiesFilter(properties, [['place%', 'like', 'Tof']]);
propertiesFilter(properties, [
['place', 'eq', 'Tofalaria'],
['area', 'ge', 21],
]);
propertiesFilter(properties, [
'any',
['place', 'eq', 'Siberia'],
['area', 'gt', 10],
]);
Commercial support
Need to fix a bug or add a feature to @nextgis/properties-filter
? We provide custom development and support for this software. Contact us to discuss options!